package com.cockatiel.statemachine.cola.statemachine.service;

import com.alibaba.cola.statemachine.Action;
import com.cockatiel.statemachine.enums.ActivityEvent;
import com.cockatiel.statemachine.enums.ActivityState;
import com.cockatiel.statemachine.model.StatemachineContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Created By Intellij IDEA
 *
 * @Author: louxiujun@kanzhun.com
 * @Date: 2023-06-11 09:11:34
 * @Description:
 */
@Component("smsStatusAction")
@Slf4j
public class SmsStatusAction implements StatusAction {

    @Override
    public Action<ActivityState, ActivityEvent, StatemachineContext> doAction() {
        return (from, to, event, ctx) -> {
            System.out.println(
                    ctx.getUserName() + " is operating " + ctx.getOrderId() + " from:" + from + " to:" + to + " on:" + event);
        };
    }
}
